﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

namespace Dummy.Web
{
    public class DictionaryRus
    {
        private static List<string> dictRus = new List<string>();

        public static void Init()
        {
            string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "dictrus.txt");            
            string[] dict = File.ReadAllLines(path);
            foreach (string dictword in dict)
                dictRus.Add(dictword.Replace(" m", "").Replace(" f", "").Replace(" n", "").Replace("ё", "е").ToLower());
        }

        public static bool WordExists(string word)
        {
            return dictRus.Contains(word.ToLower());
        }
    }
}